<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN PAGE CONTENT-->
<div class="site_content">
    <div class="realtime_content content_box no_table_filter">
        <div>
        <form class="instruct_box w5c-form demo-form" id="form_id" method="post"  role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
                <hr/>
                <div>
                    <div class="form-group form1 row">
                        <div class="col-sm-6">
                            <label class="col-sm-4">设备地址</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" ng-model="chargerId" id="chargerId" name="chargerId" placeholder="请输入16位chargerId" required="">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <label class="col-sm-4">主服务器
                                端口号
                            </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="main_port" name="main_port" ng-model="main_port" required="" placeholder="请输入20位main_port">
                            </div>
                        </div>
                    </div>
                        <div class="form-group form1 row">
                            <div class="col-sm-6">
                                <label class="col-sm-4">备用服务器
                                    IP地址
                                </label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="back_headware_ip" name="back_headware_ip" required="" ng-model="back_headware_ip" placeholder="请输入back_headware_ip">
                                </div>
                            </div>
                             <div class="col-sm-6">
                                <label class="col-sm-4">备用端口号</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="back_port" name="back_port"  placeholder="请输入back_port" ng-model="back_port" required="">
                                </div>
                            </div>
                        </div>
                    <div class="form-group form1 row">
<!--                         <div class="col-sm-6">
                            <label class="col-sm-4">is_re_register</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="is_re_register" name="is_re_register" placeholder="请输入is_re_register">
                            </div>
                        </div> -->
                        <div class="col-sm-6">
                            <label class="col-sm-4">主服务器IP</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="main_hardware_ip" name="main_hardware_ip" placeholder="请输入main_hardware_ip" required="" ng-model="main_hardware_ip">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer t_c" style="text-align: right">
                    <button style="margin-bottom:0" type="reset" class="btn btn-warning" data-dismiss="modal"><i class="fa fa-refresh"></i> 重置</button>
                    <button type="button" class="btn btn-danger"><i class="fa fa-times-circle"></i> 关闭</button>
                    <button type="button" class="btn btn-primary" w5c-form-submit="data_btn()"><i class="fa fa-check-circle-o"></i>更改</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- END PAGE CONTENT-->
</body>
<script>
function data_btn(){
        $('button.btn-primary').on('click',function(){
        $.ajax({
            type:'post',
            url:'../setHardwareServerIp',
            data:$('#form_id').serialize(),
            dataType: "json",
            async: false,
            success:function(data){
                if(data.code == '200'){
                    bootboxWindow.alert("指令下发成功!", null);
                }else{
                    bootboxWindow.alert("指令下发失败!", null);
                    $('#account').val('');
                    $('#password').val('');
                }
            },
            error:function(){
                bootboxWindow.alert("连接服务器失败",null);
            }
        })
    });
}
</script>
</html>
